package com.learner.ucenter.service;

import com.learner.pojo.user.GroupMessage;
import com.learner.pojo.user.vo.GroupHistoryResultVo;
import com.learner.pojo.user.vo.GroupMessageResultVo;
import com.learner.pojo.user.vo.HistoryMsgRequestVo;

import java.util.List;

/**
 * @author ice2020x
 * @Date: 2023/2/26
 * @Description: 群聊消息
 **/
public interface GroupMessageService {
    /**
     * 获取最近的群消息
     *
     * @param roomId    组id
     * @param pageIndex pageIndex
     * @param pageSize  pageSize
     * @return 结果
     */
    List<GroupMessageResultVo> getRecentGroupMessages(String roomId, Integer pageIndex, Integer pageSize);

    /**
     * 获取群历史消息
     *
     * @param historyMsgRequestVo 组id
     * @return 结果
     */
    GroupHistoryResultVo getGroupHistoryMessages(HistoryMsgRequestVo historyMsgRequestVo);

    /**
     * 获取群的最后一条消息
     *
     * @param roomId 组id
     * @return 结果
     */
    GroupMessageResultVo getGroupLastMessage(String roomId);

    /**
     * 添加一条群消息
     *
     * @param groupMessage groupMessage
     */
    void addNewGroupMessage(GroupMessage groupMessage);
}